---
layout: "default"
title: "Operator: %="
description: "Swift documentation for the '%=' operator."
root: "/v3.0"
---

<code class="language-swift"> operator %= {
    associativity right
    precedence 
    assignment
}</code>

<h3>Declarations</h3>

<div class="declaration" id="func-pcteq-t_-integerarithmetic_-inout-t-rhs_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-pcteq-t_-integerarithmetic_-inout-t-rhs_-t">func <wbr>%= &lt;T : _IntegerArithmetic&gt;(<wbr>_:<wbr> inout T, rhs: T)</a>
        
<div class="comment collapse" id="comment-func-pcteq-t_-integerarithmetic_-inout-t-rhs_-t"><div class="p">
    <p>Divides <code>lhs</code> and <code>rhs</code> and stores the remainder in <code>lhs</code>, trapping in
case of arithmetic overflow (except in -Ounchecked builds).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func %=&lt;T : _IntegerArithmetic&gt;(lhs: inout T, rhs: T)</code>
    
    
</div></div>
</div>
